<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    x:Class="OpenLS.Chart.UI.TitleResources"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:charts="http://schemas.Kherty.com/office/2007/chart"
    xmlns:chartui="clr-namespace:OpenLS.Chart.UI"
    xmlns:drawing="http://schemas.Kherty.com/office/2007/drawing"
    xmlns:Internals="clr-namespace:OpenLS.Chart.UI.Internals"
    xmlns:UI="clr-namespace:OpenLS.UI;assembly=OpenLS.UI"
    >
    <ResourceDictionary.MergedDictionaries>
        <drawing:TextResources/>
    </ResourceDictionary.MergedDictionaries>
    <DataTemplate DataType="{x:Type drawing:TextBody}" x:Key="chartTextBodyTemplate">
        <RichTextBox Internals:RichTextBoxHelper.FlowDocument="{Binding Document}"  Name="myrtb" Background="Transparent" BorderThickness="0" 
                     LostFocus="myrtb_LostFocus"   TextChanged="Myrtb_OnTextChanged">
            <RichTextBox.ContextMenu>
                <ContextMenu UI:RibbonElement.ControlState="Small">
                    <MenuItem Command="{x:Static ApplicationCommands.Cut}"></MenuItem>
                    <MenuItem Command="{x:Static ApplicationCommands.Copy}"></MenuItem>
                    <MenuItem Command="{x:Static ApplicationCommands.Paste}"></MenuItem>
                    <MenuItem Command="{x:Static ApplicationCommands.Delete}"></MenuItem>
                </ContextMenu>
            </RichTextBox.ContextMenu>
        </RichTextBox>
    </DataTemplate>

    <DataTemplate DataType="{x:Type charts:Title}">
        <ContentControl TextElement.FontWeight="Bold"  Content="{Binding Path=Text.Content}" TextBlock.TextAlignment="Center">
            <ContentControl.CommandBindings>
                <CommandBinding Command="{x:Static ApplicationCommands.Delete}" Executed="onDelete"></CommandBinding>
            </ContentControl.CommandBindings>
            <ContentControl.ContextMenu>
                
                <ContextMenu>
                    <MenuItem Command="{x:Static ApplicationCommands.Delete}"/>
                </ContextMenu>
            </ContentControl.ContextMenu>
        </ContentControl>
    </DataTemplate>
</ResourceDictionary>